<?php if (Yii::app()->user->hasFlash('loginflash')): ?>
    <div class="alert alert-error">
        <?php echo Yii::app()->user->getFlash('loginflash'); ?>
    </div>
<?php else: ?>

    <div id="wrapper" class="row-fluid">
        <div id="content" style="border-bottom: #006600">
            <div id="darkbanner" class="banner320">
                <h2>Iniciar Sesión</h2>
            </div>
            <div id="darkbannerwrap">
            </div>
            <?php
            $form = $this->beginWidget('CActiveForm', array(
                'id' => 'logon-form',
                'enableClientValidation' => false,
                'clientOptions' => array(
                    'validateOnSubmit' => true,
                ),
            ));
            ?>
            <div class="container-fluid" style="background-color: olivedrab">
                <!--<div class="row">-->
                    <div class="input-append lock-input">
                        <?php echo $form->textField($model, 'username', array('placeholder' => CrugeTranslator::t('logon', 'Username'))); ?>
                        <?php echo $form->error($model, 'username'); ?>
                    </div>
                <!--</div>-->
            </div>
            <div class="container-fluid" style="background-color: highlight">
                <!--<div class="row">-->
                    <div class="input-append lock-input">
                        <?php echo $form->passwordField($model, 'password', array('placeholder' => Yii::t('app', CrugeTranslator::t('logon', "Password")))); ?>
                        <?php echo $form->error($model, 'password'); ?>
                    </div>
                <!--</div>-->
            </div>
            <button type="submit" class="btn btn-success row-fluid">
                <?php echo CrugeTranslator::t('logon', "Login") ?>
                <!--<i class=" icon-long-arrow-right"></i>-->
            </button>
            <?php
//    	si el componente CrugeConnector existe lo usa:
            if (Yii::app()->getComponent('crugeconnector') != null) {
                if (Yii::app()->crugeconnector->hasEnabledClients) {
                    ?>
                    <div class='crugeconnector'>
                        <!--<span>//<?php echo CrugeTranslator::t('logon', 'You also can login with'); ?>:</span>-->
                        <ul>
                            <?php
                            $cc = Yii::app()->crugeconnector;
                            foreach ($cc->enabledClients as $key => $config) {
                                $image = CHtml::image($cc->getClientDefaultImage($key));
                                echo "<li>" . CHtml::link($image, $cc->getClientLoginUrl($key)) . "</li>";
                            }
                            ?>
                        </ul>
                    </div>
                    <?php
                }
            }
            ?>
            <?php $this->endWidget(); ?>
        </div>
    </div>   
<?php endif; ?>